package com.mywang.weitravel.modules.redlocate;

import android.os.Bundle;
import android.view.View;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.mywang.weitravel.R;
import com.mywang.weitravel.adapter.NumberListAdapter;
import com.mywang.weitravel.base.BaseFragment;
import com.mywang.weitravel.model.RedLocateListBean;

import java.util.List;

import butterknife.BindView;

/**
 * Created by wangmingyun on 2019/12/11.
 */
public class NumberFragment extends BaseFragment<RedLocatePresenter> implements RedLocateContract.View {

    @BindView(R.id.rv_list)
    RecyclerView rvList;

    private NumberListAdapter numberListAdapter;

    @Override
    protected RedLocatePresenter initPresenter() {
        return new RedLocatePresenter(this);
    }

    @Override
    protected int getFragmentLayoutID() {
        return R.layout.fragment_red_look;
    }

    @Override
    protected void initView(View view, Bundle savedInstanceState) {
        rvList.setLayoutManager(new GridLayoutManager(mActivity, 2));
        mPresenter.requestData("2");
    }

    @Override
    public void onSuccess(List<RedLocateListBean> listBeans) {
        numberListAdapter = new NumberListAdapter(mActivity, listBeans);
        rvList.setAdapter(numberListAdapter);
    }

    @Override
    public void markRedSuccess(int position) {

    }
}
